public class Student {
    private String studentId;
    private String name;
    private int age;

    // 构造函数
    public Student(String studentId, String name, int age) {
        this.studentId = studentId;
        this.name = name;
        this.age = age;
    }

    // getters 和 setters
    public String getStudentId() {
        return studentId;
    }

    public void setStudentId(String studentId) {
        this.studentId = studentId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    // 重写 toString 方法
    @Override
    public String toString() {
        return "Student{studentId='" + studentId + "', name='" + name + "', age=" + age + '}';
    }

    // 重写 equals 方法
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Student student = (Student) o;
        return studentId.equals(student.studentId);
    }

    // 重写 hashCode 方法
    @Override
    public int hashCode() {
        return studentId.hashCode();
    }
}
